# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor:	Batuhan Baserdem <lastname dot firstname at gmail>

_name="hjson-py"
pkgname="python-hjson"
pkgver=3.0.2
pkgrel=6
pkgdesc="JSON for Humans, allows comments and is less error prone."
arch=(any)
url="https://github.com/laktak/hjson-py"
license=('MIT')
makedepends=('python-setuptools')
depends=('python')
source=("$pkgname-$pkgver.tar.gz::https://github.com/hjson/hjson-py/archive/v${pkgver}.tar.gz")
sha256sums=('1c16084568a6328ba404703aad6db8ddf7e3b6afec9e141b375a40a61a209c30')

build() {
  cd "${_name}-${pkgver}"
  python setup.py build
}

check(){
  cd "${_name}-${pkgver}"
  PYTHONPATH="$PYTHONPATH:${PWD}" python hjson/tests/__init__.py
}

package() {
  cd "${_name}-${pkgver}"
  python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build
  install -Dm0644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}
